package com.example.demo.network.service;

import android.database.Observable;

import com.example.demo.bean.BaseBean;
import com.example.demo.bean.User;

import java.util.List;

import io.reactivex.rxjava3.core.Flowable;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * @Desc
 * @Author zxp
 * @Date 2024/3/14
 */
public interface UserService {

    // 传入23得到用户
    @GET("/x_aop_ng/android-examples/raw/master/Retrofit2Rxjava3Demo/app/src/main/java/com/example/demo/json/user/{userId}")
    Flowable<BaseBean<User>> getUser(@Path("userId") Long id);

    // 用户list
    @GET("/x_aop_ng/android-examples/raw/master/Retrofit2Rxjava3Demo/app/src/main/java/com/example/demo/json/userList.json")
    Flowable<BaseBean<List<User>>> getUserList();

    // 404
    @GET("/user/xxx")
    Flowable<BaseBean<String>> xxx(@Query("name") String name);

    // 获取id得到23
    @GET("/-x_aop_ng/android-examples/raw/master/Retrofit2Rxjava3Demo/app/src/main/java/com/example/demo/json/getId.json")
    Flowable<BaseBean<Long>> getId();

}
